#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#Current folder
cur_dir=`pwd`

# Make sure only root can run our script
function rootness(){
    if [[ $EUID -ne 0 ]]; then
       echo "Error:This script must be run as root!" 1>&2
       exit 1
    fi
}

# Initialization step
action=$1
[  -z $1 ] && action=help
case "$action" in
installha)
    install_all
    ;;
uninstallha)
    uninstall_all
    ;;
installss)
    install_shadowsocks
    ;;
uninstallss)
    uninstall_shadowsocks
    ;;
*)
    echo "Usage: `basename $0` {installss|uninstallss|installha|uninstallha}"
	echo ""
	echo "To Install shadowsocks use installss"
	echo "To Uninstall shadowsocks use installss"
	echo "To Install HAProxy & Keepalived use installha"
	echo "To Uninstall HAProxy & Keepalived use uninstallha"

    ;;
esac
